package cn.whb.hrm.prop;

import cn.whb.hrm.util.encrypt.ValidUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
@ConfigurationProperties(prefix = "oauth.type")
@Data
public class AuthDetailProperties {
    private AuthDetails system;
    private AuthDetails website;

    public AuthDetails getAuthDetails(Integer type){
        ValidUtils.assertNotNull(type, "没有该类型用户");
        if(type == 0){
            return system;
        }else if (type == 1){
            return website;
        }else {
            return null;
        }
    }
}
